<template>
  <div class="wrapper">
    <van-row>
      <van-col
        span="12"
        class="van-hairline--right"
      >
        <div class="types">
          <span>总收入</span>
          <p>￥{{ totalIncome }}</p>
        </div>
      </van-col>
      <van-col span="12">
        <div class="types">
          <span>已提现</span>
          <p>￥{{ cash }}</p>
        </div>
      </van-col>
    </van-row>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
  components: {},
  data () {
    return {
      totalIncome: '', // 学员总收入
      cash: '', // 已提现
    }
  },
  created () {
    this.getRevenueAndExpenses()
  },
  methods: {

    // 获取学员的总收入及提现金额
    getRevenueAndExpenses () {
      this.$axios({
        method: 'get',
        url: 'User/GetStudentRevenueAndExpensesInfo',
      }).then(res => {
        this.totalIncome = res.TotalRevenue
        this.cash = res.ExtractAmount
      })
    },
  },
})
</script>

<style scoped lang="scss">
.van-row {
  font-size: 0;
  height: 157px;
  background: #fff;
  padding: 19px 0 18px 0;
  .van-col {
    height: 100%;
  }
  .types {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    span {
      font-size: 30px;
      color: #666;
      margin-bottom: 31px;
    }
    p {
      font-size: 48px;
      color: #ba2401;
    }
  }
}
</style>
